import request from '@/utils/request';
import { getCurrentInstance } from 'vue';
const errortips =
  getCurrentInstance()?.appContext.config.globalProperties.$errortips;

/**
 * 分页查询用户
 */
export async function get_other_balance_list(params) {
  const res = await request.post('/order/other_balance/get_list', {
    ...params
  });
  if (res.data.code === 1) {
    return {
      list: res.data.data.row_list,
      columns: res.data.data.columns,
      searchData: res.data.data.search_area,
      count: res.data.data.page_info?.total,
      top_button: res.data.data.top_button
    };
  }
  return Promise.reject(res.data.msg);
}
export async function repair_order_add(params) {
  const res = await request.post('/order/other_balance/add', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data;
  }
  return Promise.reject(res.data.msg);
}
export async function repair_order_edit(params) {
  const res = await request.post('/order/other_balance/edit', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data;
  }
  return Promise.reject(res.data.msg);
}
export async function get_repair_order_detail(params) {
  const res = await request.post('/order/other_balance/detail', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data.data;
  }
  return Promise.reject(res.data.msg);
}
export async function get_goods_order_info(params) {
  const res = await request.post('/order/other_balance/goods_order_info', {
    ...params
  });
  if (res.data.code === 1) {
    return res.data.data;
  }
  return Promise.reject(res.data.msg);
}
